<?php require_once 'common/adminHeader.php';?>
<div class="nav">
当前位置：国谊学校>><a href="<?php echo siteUrl('grade/fulltimegradelist')?>">年级列表</a>>><a href="<?php echo siteUrl('fulltime/studentlist?gradeId='.$_GET['gradeId'])?>">学生列表</a>
</div>

<script language="javascript">
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked = form.chkall.checked;
	}
}

function ctrl(action)
{
	var form = document.getElementById("form1");
	var sign = false;
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != "chkall" && e.checked) sign = true;
	}

	if(!sign){
		alert("您还没有选择！");
		return;
	}

	if(action =="delCheck"){
		form.action = "<?php echo siteUrl('fulltime/delCheckStudent').'?gradeId='.$_GET['gradeId'].'&';?>menu=" + action;
		form.submit();
		return;
	}
	
	if(action =="exportExcel"){
		form.action = "<?php echo siteUrl('fulltime/studentexportexcel').'?gradeId='.$_GET['gradeId'].'&';?>menu=" + action;
		form.submit();
		return;
	}
	
	
}
</script>

<form name="form1" id="form1" method="post" action="">
	<table class="tableClass"  width="100%"  border="0" cellpadding="0" cellspacing="1">
	<tr>
			<td width="50"><input type="checkbox" value="ON" onclick="CheckAll(this.form)" name="chkall"></td>
			<td width="150">学号</td>
			<td width="150">姓名</td>
			<td width="150">最后一次缴费开始时间</td>
			<td width="150">最后一次缴费结束时间</td>
			<td width="150">状态</td>
			<td>编辑</td>
	</tr>
	
<?php $now=date('Y-m-d H:i:s');if ($form_data->studentList):?>
<?php foreach ($form_data->studentList as $key=>$value):?>
	<tr>
		<td><input type="checkbox" value="<?php echo $value['Id'];?>" name="Id[]"></td>
		<td><?php echo $value['Id'];?></td>
		<td><?php echo $value['StudentName'];?></td>
		<td><?php if($value['StartTime']!='0000-00-00 00:00:00') echo date('Y-m-d',strtotime($value['StartTime'])); ?>&nbsp;</td>
		<td><?php if($value['EndTime']!='0000-00-00 00:00:00') echo date('Y-m-d',strtotime($value['EndTime'])); ?>&nbsp;</td>
		
		<?php if($value['StartTime']!='0000-00-00 00:00:00'&&$value['EndTime']!='0000-00-00 00:00:00'){?>
			<td>缴费成功</td>
		<?php }else{?>
			<td><span class="red">暂未缴费</span></td>
		<?php }?>
		
		<td>
			<a target="_blank" href ="<?php echo siteUrl('fulltime/studentview?gradeId='.$value['GradeId'].'&studentId='.$value['Id'])?>">查看</a> 
			<a href ="<?php echo siteUrl('fulltime/studentedit?gradeId='.$value['GradeId'].'&studentId='.$value['Id'])?>">修改</a> 
			<a href ="<?php echo siteUrl('fulltime/studentdel?gradeId='.$value['GradeId'].'&studentId='.$value['Id'])?>">删除</a>
			<a href ="<?php echo siteUrl('fulltime/financeadd?gradeId='.$value['GradeId'].'&studentId='.$value['Id'])?>">缴费</a>   
			<a href ="<?php echo siteUrl('fulltime/financelist?gradeId='.$value['GradeId'].'&studentId='.$value['Id'])?>">缴费详情</a>   
		</td>
	</tr>
<?php endforeach; else:  echo '<tr><td colspan="7">暂时没有学生</td></tr>'; endif;  echo "</table>";?>
<br>

<a class="adminbutton" onclick="ctrl('exportExcel')" href="#">导出Excel</a>
<a onclick="ctrl('delCheck')" href="#">删除选中的学生</a>
</form>